package com.efounder.frame.language;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import com.utilcode.util.AppUtils;
import com.utilcode.util.LogUtils;

/**
 * @author : zzj
 * @e-mail : zhangzhijun@pansoft.com
 * @date : 2019/5/8 10:04
 * @desc :监听系统广播的接收器
 * @version: 1.0
 */
public class LocaleChangeReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
//        LogUtils.e( "mReceiver  onReceive  intent.getAction(): "+intent.getAction());

        if(intent.getAction().equals(Intent.ACTION_LOCALE_CHANGED)) {
//            当前语言设置为跟随系统时，杀掉应用，其他时候不执行操作,保存当前的系统语言
//            if(MultiLanguageSPUtil.getInstance(context).getSelectLanguage() == LanguageType.LANGUAGE_FOLLOW_SYSTEM){
//                AppUtils.exitApp();
//            }else {
//                MultiLanguageUtil.saveSystemCurrentLanguage(context);
//            }

        }

    }
}
